//  this library.
import 'package:hktk_app/ienum/package/payment_type_enum.dart';

/// 当前版本模型
class VersionModel {
  String? createdTime;
  String? modifyTime;
  String? createdBy;
  String? modifyBy;
  int? id;

  /// 客户端类型
  DeviceTypeEnum? type;

  /// 是否审核
  bool? verify;

  /// 是否升级
  bool? renewal;

  /// 是否强制升级
  bool? coercive;

  /// 版本号
  String? version;

  /// 下载地址
  String? url;

  /// 联系方式
  String? contact;

  /// 更新内容
  String? content;

  VersionModel({
    this.createdTime,
    this.modifyTime,
    this.createdBy,
    this.modifyBy,
    this.id,
    this.type,
    this.verify,
    this.renewal,
    this.coercive,
    this.version,
    this.url,
    this.contact,
    this.content,
  });

  VersionModel.fromJson(Map<String, dynamic> json) {
    createdTime = json['createdTime'];
    modifyTime = json['modifyTime'];
    createdBy = json['createdBy'];
    modifyBy = json['modifyBy'];
    id = json['id'];
    type =
    json['type'] != null ? DeviceTypeEnum.getTypeEnum(json["type"]) : null;
    verify = json['verify'];
    renewal = json['renewal'];
    coercive = json['coercive'];
    version = json['version'];
    url = json['url'];
    contact = json['contact'];
    content = json['content'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['createdTime'] = createdTime;
    data['modifyTime'] = modifyTime;
    data['createdBy'] = createdBy;
    data['modifyBy'] = modifyBy;
    data['id'] = id;
    if (type != null) {
      data['type'] = type!.name;
    }
    data['verify'] = verify;
    data['renewal'] = renewal;
    data['coercive'] = coercive;
    data['version'] = version;
    data['url'] = url;
    data['contact'] = contact;
    data['content'] = content;
    return data;
  }
}
